package com.jumlabs.data.entities.drive;

import java.io.Serializable;
import javax.persistence.*;

import org.codehaus.jackson.annotate.JsonIgnore;

import java.util.List;
import com.jumlabs.data.eventlisteners.PrimaryKeyEntityListener;

/**
 * The persistent class for the drive database table.
 * 
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@EntityListeners(value=PrimaryKeyEntityListener.class)
public class Drive implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Column(name="current_folder")
	private String currentFolder;

	private String name;

	//bi-directional many-to-one association to File
	@OneToMany(mappedBy="drive")	
	private List<File> files;

	//bi-directional many-to-one association to DriveType
	@ManyToOne
	@JoinColumn(name="drive_type_id")
	private DriveType driveType;

//	@PrePersist
//	public void onPrepersist(){
//		this.id=UUID.randomUUID().toString();
//	}
	
	
	public Drive() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCurrentFolder() {
		return this.currentFolder;
	}

	public void setCurrentFolder(String currentFolder) {
		this.currentFolder = currentFolder;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	public List<File> getFiles() {
		return this.files;
	}

	public void setFiles(List<File> files) {
		this.files = files;
	}

	public DriveType getDriveType() {
		return this.driveType;
	}

	public void setDriveType(DriveType driveType) {
		this.driveType = driveType;
	}
	

}